package com.admin.blog.vo;

//错误码统一处理
public enum ErrorCode {

    PARAMS_ERROR(10001,"参数有误"),
    ACCOUNT_PWD_NOT_EXIST(10002,"用户名或密码不存在"),
    PASSWORD_ERROR(10003,"密码错误"),
    ACCOUNT_EXIST(10004,"账号已存在"),
    NO_LOGIN(10005,"未登录"),

    TOKEN_ERROR(20001,"token不合法"),
    TOKEN_EXPIRE(20002,"token过期"),
    NO_PERMISSION(20003,"无访问权限"),
    SESSION_TIME_OUT(20004,"会话超时"),


    NO_EXIST_VIDEO(30001,"视频不存在"),
    NO_EXIST_CATEGORY_VIDEO(30002,"该分类视频不存在"),
    VIDEO_IMG_UPLOAD_FAIL(30003, "视频封面图片上传失败"),
    VIDEO_UPLOAD_FAIL(30004, "视频文件上传失败"),
    VIDEO_DELETE_FAIL(30005, "云端视频删除失败"),
    ACCOUNT_IS_EXIST(30006,"用户已经存在"),
    CATEGORY_IS_EXIST(30007,"分类已经存在"),
    NICKNAME_IS_EXIST(30008,"昵称已经存在"),
    EMAIL_EXIST(30009,"邮箱已存在"),
    TAG_IS_EXIST(30010,"标签已存在"),
    COMMENTS_IS_NOT_EXIST(30011,"评论已不存在"),

    MUST_NOT_BE_NULL(40001, "必须不为空"),
    CATEGORY_IS_NOT_EXIST(40002, "分类不存在"),
    ACCOUNT_IS_NOT_EXIST(40003, "用户不存在");


    private int code;
    private String msg;

    ErrorCode(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}